package com.chouxiaozi.simple;

import com.chouxiaozi.Guo;
import com.chouxiaozi.IProduct;
import com.chouxiaozi.Phone;

public class ProductFactory {

    public IProduct create(String product) {
        if(product.equals("phone")){
            return new Phone();
        }else if(product.equals("guo")){
            return new Guo();
        }
        throw new RuntimeException("该产品不存在!");
    }
}
